<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<style>
    .player{
        width: 100%;
        margin-bottom: 20px;
    }
    .playerInfo{
        font-size: 16px;
        line-height: 40px;
    }
    .playerList{
        display: flex;
        justify-content:space-between;
        align-items: center;
        line-height: 40px;
        font-size: 16px;
    }
    #num2{
        margin-right: 100px;
    }
</style>
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">

                        <div class="player">
                            <div class="playerList">
                                <p>第二次加密序号:<span id="num2"></span></p>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">裁判一：</label>
                            <div class="col-sm-8">
                                <input id="score1" name="name" placeholder="案例分析题" class="form-control" type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">裁判二：</label>
                            <div class="col-sm-8">
                                <input id="score2" name="name" placeholder="案例分析题" class="form-control" type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">裁判三：</label>
                            <div class="col-sm-8">
                                <input id="score3" name="name" placeholder="案例分析题" class="form-control" type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注：</label>
                            <div class="col-sm-8">
                                <input id="remarkA" name="remarkA" placeholder="备注" class="form-control" type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="button" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script src="//s.xlongwei.com/res/js/My97DatePicker/WdatePicker.js"></script>

<script>
    let obj = JSON.parse(sessionStorage.getItem("gradeObj"));
    $("#num2").html(obj.realityNm2)
    let existId = '';
    $(function (){
        $.ajax({
            url:'/jzweb/examinationAnswerSheetCom/getScoreById',
            type:'get',
            data:{
                stuSignId: obj.id
            },
            contentType: 'application/json',
            success:function (data){
                if(data.code == 0){
                    if(data.data){
                        $("#score1").val(data.data.scoingb1s);
                        // $("#score1s").val(data.data.score1s);
                        $("#score2").val(data.data.scoingb2s);
                        // $("#score2s").val(data.data.score2s);
                        $("#score3").val(data.data.scoingb3s);
                        // $("#score3s").val(data.data.score3s);
                        $("#remarkA").val(data.data.remarkA);
                        // $("#score5s").val(data.data.score5s);
                        existId = data.data.id;
                    }
                }
            },
            error : function(request) {
                parent.layer.alert("Connection error");
            },
        })
    })

    $(".btn").click(function (){
        let params = {
            cbatchId:obj.cbatchId,
            stuSignId:obj.id,
            scoingb1s:$("#score1").val(),
            scoingb2s:$("#score2").val(),
            scoingb3s:$("#score3").val(),
            remarkA:$("#remarkA").val(),
        };
        if(existId){
            params.id = existId
        }
        $.ajax({
            url:'/jzweb/examinationAnswerSheetCom/updateScore',
            type:'post',
            data:JSON.stringify(params),
            contentType: 'application/json',
            success:function (data){
                if(data.code == 0){
                    layer.msg('修改成功');
                    var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                    parent.layer.close(index);
                    parent.reLoad();
                }else  {
                    layer.msg('修改错误');
                }
            },
            error : function(request) {
                parent.layer.alert("Connection error");
            },
        })
    })

</script>

</body>
</html>
